package com.ppt.android.common.constant

import com.ppt.android.base.utils.PPTSPUtils

/**
 * 接口公共地址
 *
 * @author ZouJiaCai
 * @since 4/17/21 3:27 PM
 */
object NetBaseUrlConstant {

    val MAIN_URL = getEnvironmentDomain()
    get() {
        if (field.isEmpty()){
            throw NotImplementedError("请求改你的 MAIN_URL 的值为自己的请求地址")
        }
       return  field
    }

    private fun getEnvironmentDomain(): String {
//        return if (getApp().packageName.endsWith(".dev"))
//            BaseApplication.context.getString(R.string.DEV_HOST)
////        "http://wpan.nat300.top"
//        else
//            BaseApplication.context.getString(R.string.PRO_HOST)
//        return "http://dev-ppt.runningwiththerabbit.com/"
        return if (PPTSPUtils.get("isOnline",false) == false)
            "https://translation.googleapis.com/"
//            "https://speech.googleapis.com/"
        else
        return  "https://api.runningrabbit.cn/"
    }
}